/*copyright 2009 Kevin Daley
This file is a part of nostredamus
nostredamus is free software: you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

 This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.*/

#include "host.cu"
#include <cmath>

int demo(){
	int sz=512;
	int size=sz*sz*(1+32)*sizeof(float)+sizeof(float)*sz;
	network* k=new network;
	k->dt=3;
	k->d=.000000000000001;
	k->nu=(float*) malloc(size);
	k->uspect=new float[32];
	for(int m=0; m<32;m++){
		for(int i=0; i<sz; i++){
			for(int j=0; j<sz; j++){
				k->nu[i+sz*j+m*sz*sz]=(rand()%2)*sin(i/2*1/3-j/2*1/3); //this is the initial value of the photon density at frequency uspect[m], u and v coords. (i,j). 
				k->uspect[m]=int((rand()%int(exp(m))+2)%(int(exp(m))+1))%(m+1);
			}
		}
	}
	k->setup(2, sz, 32);
	k->evolve(.00000000000000001f,10099999);
	for(int i=0; i<sz; i++){
			for(int j=0; j<sz; j++){
				float b;
				for(int m=0; m<32;m++){
					b+=k->nu[i+sz*j+m*sz*sz];
				}
				printf("%i %i %e\n",i,j,b);
			}}
	return 0;
}